package book.Test;

import java.sql.Connection;
import java.sql.SQLException;

import org.junit.Test;

import book.dao.UserDao;
import book.dao.impl.UserDaoImpl;
import book.entity.User;
import book.utils.JdbcUtils;

public class TestUserEp {

	UserDao userDao = new UserDaoImpl();
	
	@Test
	public void getUser() throws SQLException {
		
		Connection connection = JdbcUtils.getConnection();
		String sql="SELECT user_id as userId,email,password FROM user WHERE email=? AND password=? ";
		
		User user = userDao.getUserByEP(connection, sql, User.class,"123@QQ.COM","123");
		System.out.println(user);
	}
}
